Error Creating contact with login - SOAP

Hi,

I´m new with rightnow and soap. I´m trying to create a contact with login through SOAP but I´m getting this error:

<faultstring>Data element in the Message is NULL</faultstring>
<detail>
<fault>RightNowSyncService|urn:wsdl.ws.rightnow.com/v1_3 failed
Found out-of-order or unrecognized node Login|urn:objects.ws.rightnow.com/v1_3 while parsing node of type Contact|urn:objects.ws.rightnow.com/v1_3
Failed in constructing object CreateMsg : NULL input can not be deserialized
Failed in setting value for element RNObjects array position 0 of object CreateMsg
Failure in setting value for object Create element Create of type messages_ws_rightnow_com_v1_3::CreateMsg
NULL returned from the Create deserializer due to missing or invalid XML</fault>
</detail>
</soapenv:Fault>

<ns7:RNObjects xmlns:ns4="urn:objects.ws.rightnow.com/v1_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:Contact">
<ns4:Emails>
<ns4:EmailList action="add">
<ns4:Address>newcontact@example.com</ns4:Address>
<ns4:AddressType>
<ID xmlns="urn:base.ws.rightnow.com/v1_3" id="0" />
</ns4:AddressType>
</ns4:EmailList>
</ns4:Emails>
<ns4:Name>
<ns4:First>John</ns4:First>
<ns4:Last>Doe</ns4:Last>
</ns4:Name>
<ns4:Title>MRS</ns4:Title>
<ns4:Login>jdoe</ns4:Login>
</v1:RNObjects>

If i delete "<ns4:Login>jdoe</ns4:Login>" the contact is created succesfully. I don´t know if i need another field like New Password" or i had a bad structure for login.

I appreciate your help.

P.D. i need to create contact with login when the user is created in other application, because we will use SSO later in customer portal.

Regards

Comments

I don't know why the parser is acting like this, but the problem is that the "Login" element needs to come before the "Name" element.

Just re-order your elements and the create should work

<ns7:RNObjects xmlns:ns4="urn:objects.ws.rightnow.com/v1_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:Contact">
	<ns4:Emails>
		<ns4:EmailList action="add">
			<ns4:Address>newcontact@example.com</ns4:Address>
			<ns4:AddressType>
				<ID xmlns="urn:base.ws.rightnow.com/v1_3" id="0" />
			</ns4:AddressType>
		</ns4:EmailList>
	</ns4:Emails>
	<ns4:Login>jdoe</ns4:Login>
	<ns4:Name>
		<ns4:First>John</ns4:First>
		<ns4:Last>Doe</ns4:Last>
	</ns4:Name>
	<ns4:Title>MRS</ns4:Title>
</v1:RNObjects>

Thanks..

Is there a documentation where i can find the correct order?, because i need to add more out of the box fields and custom fields

Not that I've ever seen. We don't usually construct our own SOAP envelopes but instead rely upon a toolkit (like WCF in .NETland). The output from WCF seems to be simply alphabetical (and always works). So.. try alpha sort.

Zircon - This is a contributing Drupal Theme
Design by WeebPal.