Note that there are some explanatory texts on larger screens.

plurals
  1. POBizTalk with WCF service - null object in service
    text
    copied!<p>I have a ASP.NET Webservice and am trying to call it from the BizTalk. Now I've managed for the webservice to actually be entered, but the object can't be mapped and always returns NULL. After trying and testing I finally found out that the one thing that makes it fail the mapping is the namespace on the root node. Now I have no clue how I can remove that namespace or would it be better to somehow try to adjust the webservice to use the namespace?</p> <p>My Service Method:</p> <pre><code>public bool CreateBasket(Basket basket) { if(basket == null) throw new Exception(string.Format("Basket could not be mapped on the service.")); _entities.AddToBaskets(basket); foreach (var item in basket.Items) { _entities.AddToItems(item); } return _entities.SaveChanges() &gt; 0; } </code></pre> <p>The basket object is created by the Entity Model.</p> <p>This call works:</p> <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Body&gt; &lt;CreateBasket xmlns="http://tempuri.org/"&gt; &lt;basket xmlns:ns0="http://schemas.datacontract.org/2004/07/OC.SampleCustomer.WCFService" xmlns:ns1="http://schemas.datacontract.org/2004/07/System.Data" xmlns:ns2="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/"&gt; &lt;ns0:BillingId&gt;5&lt;/ns0:BillingId&gt; </code></pre> <p>This call doesn't work:</p> <pre><code>&lt;s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;s:Body&gt; &lt;CreateBasket xmlns="http://tempuri.org/"&gt; &lt;ns0:basket xmlns:ns0="http://schemas.datacontract.org/2004/07/OC.SampleCustomer.WCFService" xmlns:ns1="http://schemas.datacontract.org/2004/07/System.Data" xmlns:ns2="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses" xmlns:ns3="http://schemas.microsoft.com/2003/10/Serialization/"&gt; &lt;ns0:BillingId&gt;5&lt;/ns0:BillingId&gt; </code></pre> <p><em>Edit</em> The BizTalk recieves the error I throw in my service method in the recieve body. So my error message on the biztalk server is "Basket could not be mapped on the service."</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload