Forum Discussion

Petrander's avatar
Petrander
New Contributor
14 years ago

Custom SOAP message not accepted by Mock service!

Hi,

I have now officially been spending a whole working week at least on this one!

I have this SOAP UI Mock service hooked up to my .NET application and running. Now I made some changes to my application so it would organize the namespaces more neatly. In other words: I want them to be defined at the top of the body and referred to by prefixes rather than repeating the namespaces all over the place.

Now the default messages go into the mockservice without problems and look like this (only top part displayed):


<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://www.noneofyour.biz/ShipmentInformationService/PutShipmentInformationMessage</Action>
</s:Header>
<s:Body
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ShipmentInformationMessage xmlns="http://www.noneofyour.biz/message/Transportation/2011/01">
<SenderId>NOSOTROS</SenderId>
<RecipientId>PARTNER</RecipientId>
<CreationTimeStamp>2011-08-09T11:34:16.3616923+02:00</CreationTimeStamp>
<Version>2.0</Version>
<TestIndicator>true</TestIndicator>
<ControlParty>
<Name xmlns="http://www.noneofyour.biz/schema/Common/2011/01">PrimaryContact</Name>
<Contact xsi:nil="true" xmlns="http://www.noneofyour.biz/schema/Common/2011/01" />
</ControlParty>
<Action>new</Action>


So these work just fine.

The custom messages now look like this (only top part displayed):


<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://www.noneofyour.biz/ShipmentInformationService/PutShipmentInformationMessage</Action>
</s:Header>
<s:Body>
<ShipmentInformationMessage
xmlns:ns1="http://www.noneofyour.biz/message/Transportation/2011/01"
xmlns:ns2="http://www.noneofyour.biz/schema/Transportation/2011/01"
xmlns:ns3="http://www.noneofyour.biz/schema/Common/2011/01">
<ns1:SenderId>NOSOTROS</ns1:SenderId>
<ns1:RecipientId>PARTNER</ns1:RecipientId>
<ns1:CreationTimeStamp>2011-08-09T10:53:58.9879744+02:00</ns1:CreationTimeStamp>
<ns1:Version>2.0</ns1:Version>
<ns1:TestIndicator>true</ns1:TestIndicator>
<ns1:ControlParty>
<ns3:Name>PrimaryContact</ns3:Name>
<ns3:Contact p6:nil="true" xmlns:p6="http://www.w3.org/2001/XMLSchema-instance">
</ns3:Contact>
</ns1:ControlParty>
<ns1:Action>new</ns1:Action>


Now there are some main differences, especially when regarding the namespaces and the s:Body element. AND these messages throw an error in the SOAP UI Mock service every single time!

The response I get back is this:


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>Server</faultcode>
<faultstring>Missing operation for soapAction [http://www.noneofyour.biz/ShipmentInformationService/PutShipmentInformationMessage] and body element [ShipmentInformationMessage] with SOAP Version [SOAP 1.1]</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>


Likewise, I find the following error message in the error log of Soap UI:

Tue Aug 09 14:19:31 CEST 2011:ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [http://www.noneofyour.biz/ShipmentInformationService/PutShipmentInformationMessage] and body element [ShipmentInformationMessage] with SOAP Version [SOAP 1.1]
com.eviware.soapui.impl.wsdl.mock.DispatchException: Missing operation for soapAction [http://www.noneofyour.biz/ShipmentInformationService/PutShipmentInformationMessage] and body element [ShipmentInformationMessage] with SOAP Version [SOAP 1.1]


But the error message does not make sense as I did include the right operation by its correct name, as well as the body element (ShipmentInformationMessage), and the only differences between the two messages pertain the namespaces!

This is driving me up the wall! What is the exact cause of this problem and what is needed for this to work!?

Thanks in advance for any help!
  • Petrander's avatar
    Petrander
    New Contributor
    I got it to work!!! I finally got the code to generate the SOAP message with all its namespaces properly.
    This is the (top part of the) message that works, please note the prefix for ShipmentInformationMessage-element, exactly how I wanted it:


    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://www.logiasoftware.fi/ShipmentInformationService/PutShipmentInformationMessage</Action>
    </s:Header>
    <s:Body>
    <ns1:ShipmentInformationMessage xmlns:ns2="http://www.logiasoftware.fi/schema/Transportation/2011/01" xmlns:ns3="http://www.logiasoftware.fi/schema/Common/2011/01" xmlns:ns1="http://www.logiasoftware.fi/message/Transportation/2011/01">
    <ns1:SenderId>DKITELLA</ns1:SenderId>
    <ns1:RecipientId>PARTNER</ns1:RecipientId>
    <ns1:CreationTimeStamp>2011-08-10T07:44:52.9423961+02:00</ns1:CreationTimeStamp>
    <ns1:Version>2.0</ns1:Version>
    <ns1:TestIndicator>true</ns1:TestIndicator>
    <ns1:ControlParty>
    <ns3:Name>PrimaryContact</ns3:Name>
    <ns3:Contact d5p1:nil="true" xmlns:d5p1="http://www.w3.org/2001/XMLSchema-instance" />
    </ns1:ControlParty>
    <ns1:Action>new</ns1:Action>


    I am a happy man now after being at this for a week!