Pergunta

I have created a solution. Added the WSDL file. This keeps on popping following error "Length Required".

I tried with the above code in the post (, but seems that is not working. Where do we specify the Operation name here?

-- Anand

Foi útil?

Solução

Before getting it to work in java c# .net etc you need to get the SOAP xml correct.

The operation name is added as a tag in the soap body element. Say for example your operation name is createMyOTRSTicket as specified in OTRS UI Web Service. The SOAP request sent should look something like this like this:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
    <createMyOTRSTicket xmlns="WS">          
         <UserLogin>MyUserName</UserLogin>
         <Password>MyPassword</Password>
             <Queue>'some queue name'</Queue>
             <State>'some state name'</State>
             <Priority>1</Priority>
             <!-- ...etc.. --> 
         <Article>
             <Subject>some subject</Subject>
             <Body>some body</Body>
             <ContentType>text/plain; charset=utf8</ContentType>
        </Article>
    </createMyOTRSTicket >
</soap:Body>
</soap:Envelope>

See the API for what elements are require and which are optional for TicketCreate here

The Soap Message should be sent to /nph-genericinterface.pl/Webservice/CreateTicketWS where CreateTicketWS is the name of the Web Service. Also note that the attribute xmlns="WS" refers to the Namespace you specify in "Network Transport" config also locatred in the GenericInterface Web Service Management. I hope this helps you. Sorry it might be a bit confusing for someone new to SOAP and OTRS.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top