Could not connect to host - try to setup connection from SAP to Magento - web-services

I need to setup a connection from SAP to Magento (unidirectional).
From the SAP part i get a wsdl file and a message (xml file with specific data) which is sent via SOAP. My problem is to receive the data which comes with the xml.
My attempt is to load the wsdl file, try to get a connection and load a delivered method.
You can see my attempts here:
$wsdl = 'url-to-the-wsdl.wsdl';
try {
$client = #new SOAPClient($wsdl);
$response = $client->method();
} catch (Exception $e) {
echo $e->getMessage();
}
die(var_dump($response));
The problem is I still get the error Message: Could not connect to host.
Honestly I'm still confused if this is the right way to get this done. If anyone could give me a hint that at least this part is correct so far I would be relieved. If not, any suggestions or tipps would be appreciated.

Related

Cloud9 VFS connection does not exist error [Node JS]

I was trying out the Cloud9 IDE from AWS by creating a "Hello World" application in Node JS. I used the guide from the following link but when I went to "Preview" my application the browser showed a page that said the "VFS connection does not exist". I am pretty new to server management and I don't know what VFS stands for, so I don't know where to start looking for a solution. All of my searches led to forums of people talking about ruby on rails, and the error was specific to that framework. Anyone experiencing the same problem, and are there any solutions?
let express = require("express");
let app = express();
app.get("/", (req,res) => {
console.log("Hello");
});
app.listen(8080,"127.0.0.1",() => {
console.log("Server Running ...");
});
P.S. I know I am not sending a page back in this code, I just want the console to output the "Hello" statement so that I know that the server is receiving the requests.
Try using Internet Explorer. I also faced this issue in Google Chrome. I don't know why this happens, but Internet Explorer is the solution.

Test Client SOAPFaultException

Hi I'm getting below exception when I'm hitting my service using test client .
Can any one help where I went wrong if need any inputs required please tell
javax.xml.ws.soap.SOAPFaultException: unknown
at com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
at com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
at $Proxy28.publishTravelItinerary(Unknown Source)
you are choosing wrong end point url to invoke webservice from your client.
If you will open ur wsdl,There would be more than one end point url in your wsdl. choose as you configure at your server.
Thanks,
ambuj
"Master yourself, Master the enemy"

Fatal error: Uncaught CurlException: 7 can't connect to Facebook Graph API

I'm struggling to access Facebook's Graph API (I am on WAMP, Apache 2.4.4, PHP 5.4.12) and get that Curl error:
Fatal error: Uncaught CurlException: 7: Failed connect to graph.facebook.com:443; No error thrown in base_facebook.php on line 994
First, my code, then what I tried:
$facebook = new Facebook($config);
$uid = $facebook->getUser();
$user_profile = $facebook->api('/me','GET');
echo $user_profile['name'];
I don't give anything since it's not relevant, I successfully connect with Javascript, using Facebook's code. I am then connected.
$facebook = new Facebook($config);
$uid = $facebook->getUser();
These two lines work without problem, I'm connected, and if I echo the user id it corresponds to the one found using the web graph tool.
The problem comes from the $facebook->api which gives the error. I got rid of the timeout problems (by increasing both curl and Apache's time (I'm at 300 sec)). Curl is installed (I had to used it before and phpinfo shows it running). I also checked the IPV4/IPV6 problem, I asked Apache to only listen 0.0.0.0:80 and forced CURL to only use IPV4:
curl_setopt( $ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
Finally, I checked the port 80, which seems to be listened by my Apache (the test port 80 of Apache says it's used by "Server: Apache/2.4.4 (Win64) PHP/5.4.12). Perhaps there's another problem with that port (it's the thing I know the less about), but WAMP seems to work fine, and I still manage to connect to Facebook with my page.
Anybody got any clue? Because I have the feeling that I tried every solution I found so far, both on Stackoverflow and Google.
Have a good day,
Morphilos

does elmah send errors to mail even if they got filtered ?

I have a web site mvc4 c# using elmah error logging. in my web config I declared email send on error from elmah and error filtering in code in global.asax :
void ErrorLog_Filtering(object sender, ExceptionFilterEventArgs e)
{
if (e.Exception.GetBaseException() is InvalidOperationException)
{
if (e.Exception.Message.StartsWith("The connection id is in the incorrect format"))
e.Dismiss();
}
}
when I go to my http://mydomain/elmah.axd I see no more errors that got filtered.
but I get them to mail.
i.e - if the application has error ""The connection id is in the incorrect format" ,I get notify on email by elmah, and I don't want to be notify ... is there a way to filter it also in mail notifications ?
I had the same issue. You have to define a second function to filter out the Emails separately. The signature of this function is:
void ErrorMail_Filtering(object sender, ExceptionFilterEventArgs e)
{
}
Calling e.Dismiss() within this method will prevent the Exception from being e-mailed.
See https://code.google.com/p/elmah/wiki/ErrorFiltering

Webservice having "No such operation: HTTP GET PATH_INFO"

I currently have a SOAP web service and I am trying to access it's endpoint but I keep getting this error:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>
No such operation: (HTTP GET PATH_INFO: /camel-example-reportincident/webservices/incident)
</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
UNIT TEST
package org.apache.camel.example.reportincident;
import junit.framework.TestCase;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.jvnet.mock_javamail.Mailbox;
/**
* Unit test of our routes
*/
public class ReportIncidentRoutesTest extends TestCase {
private CamelContext camel;
// should be the same address as we have in our route
private static String ADDRESS = "cxf://http://localhost:8080/camel-example-reportincident/webservices/incident"
+ "?serviceClass=org.apache.camel.example.reportincident.ReportIncidentEndpoint"
+ "&wsdlURL=report_incident.wsdl";
protected void startCamel() throws Exception {
camel = new DefaultCamelContext();
camel.addRoutes(new ReportIncidentRoutes());
camel.start();
}
protected static ReportIncidentEndpoint createCXFClient() {
// we use CXF to create a client for us as its easier than JAXWS and works
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(ReportIncidentEndpoint.class);
factory.setAddress(ADDRESS);
return (ReportIncidentEndpoint) factory.create();
}
public void testRendportIncident() throws Exception {
// start camel
startCamel();
// assert mailbox is empty before starting
Mailbox inbox = Mailbox.get("incident#mycompany.com");
assertEquals("Should not have mails", 0, inbox.size());
// create input parameter
InputReportIncident input = new InputReportIncident();
input.setIncidentId("123");
input.setIncidentDate("2008-08-18");
input.setGivenName("Claus");
input.setFamilyName("Ibsen");
input.setSummary("Bla");
input.setDetails("Bla bla");
input.setEmail("davsclaus#apache.org");
input.setPhone("0045 2962 7576");
// create the webservice client and send the request
ReportIncidentEndpoint client = createCXFClient();
OutputReportIncident out = client.reportIncident(input);
// assert we got a OK back
assertEquals("0", out.getCode());
// let some time pass to allow Camel to pickup the file and send it as an email
Thread.sleep(3000);
// assert mail box
assertEquals("Should have got 1 mail", 1, inbox.size());
// stop camel
camel.stop();
}
}
I am attempting to use CFX endpoint along with my camel routing and when I am putting the endpoint address in the route and then unit testing it I am getting a "No endpoint could be found for: //path/to/endpoint".
I am assuming that the fact that I am getting an error when I try to access the endpoint url is the issue but I do not even know where to begin on figuring out how to fix it.
When I hit my webservice on SOAP UI it runs fine as well. Any help would be greatly appreciated, and I can provide any info that is needed.
Typically, SOAP services are exposed over HTTP using the POST operation. You seem to be trying to access the service using the GET operation.
I am not sure how you try to invoke the service in your unit test, but you need to make sure it's a HTTP/POST call. If you are using plain HTTP, then you could set a header before invoking the HTTP component.
.setHeader(Exchange.HTTP_METHOD, constant("POST"))
Show your unit test for more detailed input.
#grep
I see this post as bit old, but still will try to answer if anyone else with similar problem is able to. Well, I had the same isssue and wondered what were the reason s behind those. here are the two steps that i tried and fixed up the issue. make sure you are able to access the wsdl in browser.
Close the SOAPUI, delete the soapui_workspace.xml created in user folder under C:/users.
Restart the Soap_ui and open up preferences>Proxy setting.
Change from automatic to None.
Create new project.
This did solved my issue and got the response from webservice in SOAPUI.