Friday, 6 September 2013

BlackBerry-10 : Object reference not set to an instance of an object error

BlackBerry-10 : Object reference not set to an instance of an object error

I am attempting to send a soap request from a BlackBerry 10.1 device to a
.Net created web service. I have checked the web service to see if it will
work and it does what it is supposed to do. I have also verified that the
QtSoapHttpTransport is connecting to the .Net web service, because I was
initially getting errors that values were not filled in.
I set the .Net web service to default values when nothing is sent, but now
I get the Object reference error.
This is an internal web service so, I can't provide a url to check.
In the c++ code I have the code to setup the soap connection. m_soap is
the QtSoapHttpTransport, defined elsewhere.
m_soap.setAction("http://myServer/WebServices/insertSalesLead");
m_soap.setHost("myServer");
QtSoapMessage request;
request.setMethod(QtSoapQName("insertSalesLead",
"http://myServer/WebServices"));
request.addMethodArgument("AssociateEmail","http://myServer/WebServices/",QString("joe.smith@compnay.com"));
... multiple parameters
m_soap.submitRequest(request, "/WebServices/MarketingWebServices.asmx");
Here is the web service soap information
POST /WebServices/MarketingWebServices.asmx HTTP/1.1
Host: myServer
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://myServer/WebServices/insertSalesLead"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<insertSalesLead xmlns="http://myServer/WebServices">
<AssociateEmail>string</AssociateEmail>
<ShowName>string</ShowName>
<LeadID>string</LeadID>
<LeadFirstName>string</LeadFirstName>
<LeadLastName>string</LeadLastName>
<Company>string</Company>
<LeadJobTitle>string</LeadJobTitle>
<AddrLine1>string</AddrLine1>
<AddrLine2>string</AddrLine2>
<City>string</City>
<StateRegion>string</StateRegion>
<Country>string</Country>
<PostalCode>string</PostalCode>
<Phone>string</Phone>
<PhoneExt>string</PhoneExt>
<Fax>string</Fax>
<LeadEmail>string</LeadEmail>
<PurchasingTimeframe>string</PurchasingTimeframe>
<DecisionMakingRole>string</DecisionMakingRole>
<ActionAnswers>string</ActionAnswers>
<InsertingProducts>string</InsertingProducts>
<AccesoriesServices>string</AccesoriesServices>
<SortingProducts>string</SortingProducts>
<SoftwareSolutions>string</SoftwareSolutions>
<PostalSoftware>string</PostalSoftware>
<OtherAreas>string</OtherAreas>
<Comments>string</Comments>
</insertSalesLead>
</soap:Body>
I don't know if there is something more I need to do with the request
creation or if I need to add a parameter to the .Net web service in order
to get this to work.

No comments:

Post a Comment