cancel
Showing results for 
Search instead for 
Did you mean: 

Web Service with SOAP attachment.

Former Member
0 Kudos

Hi,

I have a webservice which takes one parameter as a string, and takes another parameter as a SOAP attachment.

I have implemented this as a stateless EJB (as suggested in the tutorials).

However when I post to the web service, it doesnt seem to be able to get the soap message, and gives the following error (in the soap envelope):

com.sap.engine.services.webservices.espbase.server.additions.exceptions.ProcessException: Deserializing fails. Nested message: Expected parameter element with name source, found correlationId..

For reference the parts in the wsdl are:

<message name="submitMessage">

<part name="correlationId" type="xsd:string"/>

<part name="source" type="xsd:anyType"/> </message>

and the mime aspect as follows:

<input>

<mime:multipartRelated>

<mime:part>

<soap:body use="literal" namespace="http://mynamespace/" parts="correlationId"/>

</mime:part>

<mime:part>

<mime:content part="source" type="text/xml"/></mime:part>

</mime:multipartRelated>

</input>

I have checked the packets going to the server and the SOAP attachment is definately there. Just seems like the sap engine cannot parse the attachment and reconcile it to one of the parameters.

Any ideas?

Regards,

Andrew

Edited by: Andrew Morton on Feb 29, 2008 10:55 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi.

I seem to have found the solution.

It is a change to the wsdl to include a binding.

Many thanks for your help.

Regards,

Andrew

0 Kudos

Hi Andrew,

Would you supply the whole wsdl file, we would like to check it on our own?

Thanks in advance.

~Dimitar

Former Member
0 Kudos

Dimitar,

The wsdl is shown as follows.

(Some namespace changes from initial posting, but this is the one we are using.)

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

<definitions

xmlns="http://schemas.xmlsoap.org/wsdl/"

xmlns:tns="http://amt_ws/"

xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"

xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"

xmlns:tns0="http://amt_ws/types/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

name="MarketMessageService" targetNamespace="http://amt_ws/">

<types>

<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://amt_ws/types/">

<element name="ResendRequiredFault" type="tns0:ResendRequiredFault_Type"/>

<complexType name="ResendRequiredFault_Type">

<sequence>

<element name="correlationId" type="xsd:string"/>

<element name="reason" type="xsd:string"/>

</sequence>

</complexType>

<element name="SubmissionFailedFault" type="tns0:SubmissionFailedFault_Type"/>

<complexType name="SubmissionFailedFault_Type">

<sequence>

<element name="correlationId" type="xsd:string"/>

<element name="reason" type="xsd:string"/>

</sequence>

</complexType>

</schema>

</types>

<message name="MarketMessageServicePortType_submitMarketMessage">

<part name="correlationId" type="xsd:string"/>

<part name="source" type="xsd:anyType"/>

</message>

<message name="MarketMessageServicePortType_submitMarketMessageResponse">

<part name="receipt" type="xsd:string"/>

</message>

<message name="MarketMessageServicePortType_ResendRequiredFault">

<part name="resendFault" element="tns0:ResendRequiredFault"/>

</message>

<message name="MarketMessageServicePortType_SubmissionFailedFault">

<part name="failedFault" element="tns0:SubmissionFailedFault"/>

</message>

<portType name="MarketMessageService">

<operation name="submitMarketMessage" parameterOrder="correlationId source">

<input message="tns:MarketMessageServicePortType_submitMarketMessage"/>

<output message="tns:MarketMessageServicePortType_submitMarketMessageResponse"/>

<fault name="resendFault" message="tns:MarketMessageServicePortType_ResendRequiredFault"/>

<fault name="failedFault" message="tns:MarketMessageServicePortType_SubmissionFailedFault"/>

</operation>

</portType>

<binding name="MarketMessageServiceSoapHttp" type="tns:MarketMessageService">

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

<operation name="submitMarketMessage">

<soap:operation soapAction="http://amt_ws//submitMarketMessage"/>

<input>

<mime:multipartRelated>

<mime:part>

<soap:body use="literal" namespace="http://amt_ws/" parts="correlationId"/>

</mime:part>

<mime:part>

<mime:content part="source" type="text/xml"/>

</mime:part>

</mime:multipartRelated>

</input>

<output>

<soap:body use="literal" namespace="http://amt_ws/"/>

</output>

<fault name="resendFault">

<!-- <soap:fault name="resendFault" namespace="http://amt_ws/types" use="literal"/>-->

<soap:fault name="resendFault" use="literal"/>

</fault>

<fault name="failedFault">

<!<soap:fault name="failedFault" namespace="http://amt_ws/types" use="literal"/>>

<soap:fault name="failedFault" use="literal"/>

</fault>

</operation>

</binding>

<wsdl:service xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="DTSMarketMessageServices">

<wsdl:port name="MarketMessageServicePort" binding="tns:MarketMessageServiceSoapHttp">

<soap:address location="PUT ACTUAL ADDRESS HERE"/>

</wsdl:port>

</wsdl:service>

</definitions>