Hi, I am just trying to create a new card using webservices through Soap Sonar (a soap testing tool). I can connect to the wsdl but get authentication errors when I try to do anything. I am just trying to use username = admin and password = admin. I read in the pdf about WSS but not sure how to do this in a XML. Does anyone have an example XML I can see to do a simple create card? Thanks Mike mwhitlock@ercot.com
I read on another post that…
- Passwords have to be digested, unless the property force.ws.password.digest is set to false in auth.conf
If I make this change, can I just use basic authentication? If anyone has an example xml that is sent to the wdsl to create or update a card would help out so much. Please help!!!
Thanks in advance,
Mike
Hi Mike, yes, as you read the password needs to be digested.
If you want to use the text password you need to:
1. stop tomcat
2. open the file ${cmdbuild_webapp}/WEB-INF/classes/org/cmdbuild/soapws-r1.xml
2. remove the comment marked as "Fix for non-standard webservice clients" that adds a new bean to the xml: <ref bean="addDefaultNamespaceInterceptor"/>
3. restart tomcat
Best regards,
the CMDBuild Team
Thank you for your response. I did make that change as you said. After restarting tomcat, I logged into SoapUI and I am trying to use createCard. I am using username = admin and password = admin in the properties. I will put the xml and the response that I get back from SoapUI below. Based of those xmls, can you give me advice on how to get this to work and create a new Card through this web service? Thank you very much again!!!
Here are the xmls...
<soap:Header/>
<soap:Body>
<soap1:createCard>
<!--Optional:-->
<soap1:cardType>
<!--Zero or more repetitions:-->
<soap1:attributeList>
<!--Optional:-->
<soap1:code>123</soap1:code>
<!--Optional:-->
<soap1:name>soapui1</soap1:name>
<!--Optional:-->
<soap1:value>1234</soap1:value>
</soap1:attributeList>
<!--Optional:-->
<soap1:beginDate></soap1:beginDate>
<!--Optional:-->
<soap1:className>Server</soap1:className>
<!--Optional:-->
<soap1:endDate></soap1:endDate>
<soap1:id>1000</soap1:id>
<!--Zero or more repetitions:-->
<soap1:metadata>
<!--Optional:-->
<soap1:key>soapui1</soap1:key>
<!--Optional:-->
<soap1:value>1234</soap1:value>
</soap1:metadata>
<!--Optional:-->
<soap1:user>admin</soap1:user>
</soap1:cardType>
</soap1:createCard>
</soap:Body>
</soap:Envelope>
I just get this response back...
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Sender</soap:Value>
<soap:Subcode>
</soap:Subcode>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">An error was discovered processing the <wsse:Security> header</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Please help.
FYI… I just saw that in Request Properties in SoapUI, I had WSS-Pasword Type = None in the example above. If I change this drop down to WSS-Password Type = PasswordText then I get this response back…
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Sender</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Unmarshalling Error:</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I am not sure what option to select on this, but wanted to show all the info so hopefully someone can help me get this web service to actually create a card. Thanks again.
Mike
UPDATE… I changed the request again and now get a new error. I think it is actually receiving the request now because the error says “Fault occurred while processing.” Can someone help me out on what values to enter on the xml request??? Thanks, Mike
request...
<soap:Header/>
<soap:Body>
<soap1:createCard>
<!--Optional:-->
<soap1:cardType>
<!--Zero or more repetitions:-->
<soap1:attributeList>
<!--Optional:-->
<soap1:code>123</soap1:code>
<!--Optional:-->
<soap1:name>soapuitest</soap1:name>
<!--Optional:-->
<soap1:value>1234</soap1:value>
</soap1:attributeList>
<soap1:id>100000</soap1:id>
<!--Zero or more repetitions:-->
<soap1:metadata>
<!--Optional:-->
<soap1:key>soapuitest</soap1:key>
<!--Optional:-->
<soap1:value>1234</soap1:value>
</soap1:metadata>
<!--Optional:-->
<soap1:user>admin</soap1:user>
</soap1:cardType>
</soap1:createCard>
</soap:Body>
</soap:Envelope>
response...
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Fault occurred while processing.</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Mike, it looks like you don't have inserted any credential because the Header tag is empty.
<soap:Header/>
Best regards,
the CMDBuild Team
Thanks again. Here is the request with the header information. What I am asking is what fields do I need to put data into to create a card in the xml? For example, do I need to put a value in for the id field (and if so what number do I put here or is it auto-generated). What other fields are required because I just keep getting errors.
Sent...
<soap:Body>
<soap1:createCard>
<!--Optional:-->
<soap1:cardType>
<!--Zero or more repetitions:-->
<soap1:attributeList>
<!--Optional:-->
<soap1:code>1</soap1:code>
<!--Optional:-->
<soap1:name>2</soap1:name>
<!--Optional:-->
<soap1:value>3</soap1:value>
</soap1:attributeList>
<!--Optional:-->
<soap1:beginDate>2014-06-17</soap1:beginDate>
<!--Optional:-->
<soap1:className>Asset</soap1:className>
<!--Optional:-->
<soap1:endDate>2014-07-17</soap1:endDate>
<soap1:id>777</soap1:id>
<!--Zero or more repetitions:-->
<soap1:metadata>
<!--Optional:-->
<soap1:key>8</soap1:key>
<!--Optional:-->
<soap1:value>9</soap1:value>
</soap1:metadata>
<!--Optional:-->
<soap1:user>10</soap1:user>
</soap1:cardType>
</soap1:createCard>
</soap:Body>
</soap:Envelope>
Response...
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Fault occurred while processing.</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Any help?
Thanks again for the response. Here is the request and response with the header information but I keep getting "Fault occurred while processing". What I am looking for is what fields are required for the CreateCard to actually create a card?
request...
<soap:Body>
<soap1:createCard>
<!--Optional:-->
<soap1:cardType>
<!--Zero or more repetitions:-->
<soap1:attributeList>
<!--Optional:-->
<soap1:code>1</soap1:code>
<!--Optional:-->
<soap1:name>2</soap1:name>
<!--Optional:-->
<soap1:value>3</soap1:value>
</soap1:attributeList>
<!--Optional:-->
<soap1:beginDate>2014-06-17</soap1:beginDate>
<!--Optional:-->
<soap1:className>5</soap1:className>
<!--Optional:-->
<soap1:endDate>2014-07-17</soap1:endDate>
<soap1:id>777</soap1:id>
<!--Zero or more repetitions:-->
<soap1:metadata>
<!--Optional:-->
<soap1:key>8</soap1:key>
<!--Optional:-->
<soap1:value>9</soap1:value>
</soap1:metadata>
<!--Optional:-->
<soap1:user>10</soap1:user>
</soap1:cardType>
</soap1:createCard>
</soap:Body>
</soap:Envelope>
response...
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Fault occurred while processing.</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I was able to get the web services to work. Thanks -Mike