cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP service could not be loaded: premature end of file

Former Member
0 Kudos

Hi,

I am trying to call some web services using the Web Service action in the logic editor, but I am always getting some errors. For instance, for an online service (e.g. http://webservices.imacination.com/distance/Distance.jws) I am getting:

"SOAP service could not be loaded: Premature end of file."

I've tried 3 different web services that are available out there, and no result. I've laso tried writing it like this:

http://webservices.imacination.com/distance/Distance.jws/ or

http://webservices.imacination.com/distance/Distance.jws?wsdl

, but the result was the same.

I've also tried a web service that's currently deployed on my machine, using Tomcat. Here, I'm getting some slightly different errors:

http://localhost:8080/epcis-repository-0.2.0/capture/

SOAP service could not be loaded: the element type "HR" must be terminated by the matching end-tag "</hr>"

http://localhost:8080/epcis-repository-0.2.0/capture or

http://localhost:8080/epcis-repository-0.2.0/capture?wsdl

SOAP service could not be loaded: WSDLEXception (at /html): faultCode=INVALID_WSDL: Expected element 'definitions'.

As a note, this web service that I have deployed locally is also available online (http://demo.accada.org/epcis/capture), and if I try out this one, the error is again:

SOAP service could not be loaded: Premature end of file.

As far as I could tell, the /epcis/capture webservice is document/literal, so I don't think this should be a problem. I have read other posts about people having similar problems, but I could not find the answer to my problem...

Can anyone please help?

Thanks in advance!

Angela

Accepted Solutions (1)

Accepted Solutions (1)

abesh
Contributor
0 Kudos

Hi Angela,

Does your company use a firewall to access the internet ? If yes, then you would have to configure xMII to access the internet through the firewall.

Please refer to the blog : <a href="/people/abesh.bhattacharjee/blog/2007/03/12/send-sms-to-india-from-xmii-115:///people/abesh.bhattacharjee/blog/2007/03/12/send-sms-to-india-from-xmii-115

to know how it is done

If you configure the proxy in xMII be sure to add local addresses that you want to access without the proxy to the ProxyBypassList.

Hope this helps.

Former Member
0 Kudos

Hi,

Thanks a lot, everyone, for your answers! Yes, the firewall and the "rpc/encoded" encoding might explain why the first two web services did not work...

However, it does not explain why the web service installed locally does not work, since it is "document/literal" encoded, as far as I could tell..... And unfortunately, this one is the one that I need to connect to (the others I was only using for testing). Again, this is the error message that I get:

SOAP service could not be loaded: WSDLEXception (at /html): faultCode=INVALID_WSDL: Expected element definitions'.

Parts of the wsdl file are copied bellow, and I can't see anything wrong with it (certainly no <definitions/> missing):

<?xml version="1.0" encoding="UTF-8"?>

<!-- EPCIS QUERY SERVICE DEFINITIONS -->

<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:epcis="urn:epcglobal:epcis:xsd:1" xmlns:epcisq="urn:epcglobal:epcis-query:xsd:1" xmlns:epcglobal="urn:epcglobal:xsd:1" xmlns:impl="urn:epcglobal:epcis:wsdl:1" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:epcglobal:epcis:wsdl:1">

...

<wsdl:binding name="EPCISServiceBinding" type="impl:EPCISServicePortType">

<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="getQueryNames">

<wsdlsoap:operation/>

<wsdl:input>

<wsdlsoap:body use="literal"/>

</wsdl:input>

<wsdl:output>

<wsdlsoap:body use="literal"/>

</wsdl:output>

...

</wsdl:operation>

</wsdl:binding>

...

</wsdl:definitions>

As a side note, I now get the same error message if I try to connect from outside the company's firewall to the same web service available on the internet (http://demo.accada.org/epcis/capture?wsdl).

Does anyone have any more ideas?

Thank you once again in advance!

Angela

0 Kudos

Angela,

I believe that it is because you have the Namespace difined incorrectly for wsdl...It should read:

xmlns:<b>wsdl=</b>"http://schemas.xmlsoap.org/wsdl/" and not xmlns:"http://schemas.xmlsoap.org/wsdl/">

Actually you have this namspace entered twice, the first time it is incorrect and the second time is fine, simply remove the first incorrect entry....

Hope this helps.

-Sam

Message was edited by:

Salvatore Castro

sufw
Active Participant
0 Kudos

Hi Angela,

In the past, I've used an open-source tool called soapUI to diagnose issues with web services. Amongst other things, the tool can validate WSDLs which can help in diagnosing problems...

Sascha

Former Member
0 Kudos

Hi,

Thanks for your suggestion regarding the xmlns:wsdl="..."! Unfortunately, I tried it, but it does not solve the error (which is quite unexpected, since your suggestion makes a lot of sense...)

So I was wondering if anyone knows how I can disable the wsdl validation in the WebService action call in xMII (I don't know if this will solve anything, but it's worth a try)

Best,

Angela

0 Kudos

Angela,

Are you getting the same error message as before? Also, I recommend following Sascha's suggestion in using SOAPUI to validate the operation of your Web Service. Finally, use the POST action block and set the SOAP Request XML as the body of the document you are posting. This will bypass the validation that the Web Service action goes through. Essentially a POST and WebService call are the same thing except the POST typically does not have a Body and the WebService call does. Hope this helps.

-Sam

henrique_pinto
Active Contributor
0 Kudos

Angela,

there is nothing wrong with the namespace declarations (the xmlns:wsdl is there, in the middle of the other declarations; the initial one is just declaring the default namespace as the same).

The problem could be that the soap service expects the <wsdl:definitions> tag as the 1st line of the xml (after xml declaration).

Would it be possible to remove the comment tag (<!-- EPCIS QUERY SERVICE DEFINITIONS -->) only for test purposes and try it once more?

Regards,

Henrique.

Answers (2)

Answers (2)

0 Kudos

Angela,

There is a way around the unsupported RPC call by using the POST action instead. This requires a little bit more work since you have to define the SOAP request XML in the editor and map it into the PostData String field of the action. There are other forum threads that talk about this as well but it should be pretty straight-forward to figure out.

-Sam

Former Member
0 Kudos

Hello, Angela.

The web service you are trying to access uses an outdated style of SOAP web service encoding called "rpc/encoded". SAP xMII only supports the WS-I recommended style of encoding called "document/literal".

Best regards,

Rick