Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

Chat Third Party Queue UQ API - SetAgentState - SOAPFault Inavlid Agent ID (1 Comment)

$
0
0

Topic by Vladimir Silva

Content

Hi,

I am trynbing to call SetAgentState in the 3rd party Queue API like this:

    public void setAgentState(long agentID, boolean available)  
    {  
        ID agentClientID = new ID();  
        agentClientID.setId(agentID);  
      
        UnsignedLong subState = new UnsignedLong(21);  
        ChannelTypeEnum channelType = ChannelTypeEnum.CHAT;  
        
        try  
        {  
            SetAgentState request = new SetAgentState();
            SetAgentStateMsg params = new SetAgentStateMsg();
            
            params.setTransactionRequestData(createTransactionRequest()); // transactionRequest);
            params.setAgentClientID(agentClientID);
            params.setAvailable(available);
            params.setSubState(subState);
            params.setChannel(channelType);
            
            request.setSetAgentState(params);
            
            System.out.println("SetAgentState: AgentClientID:" + agentClientID.getId());
            System.out.println("SetAgentState: Channel Type:" + channelType + " Substate:" + subState );
            
            uqService.setAgentState(request, clientInfoHeader);  
        }  
        catch (Exception e)  
        {  
            e.printStackTrace();
            System.err.println("SetAgentState:" + e.getMessage());  
        }  
    }
 

--- MAIN

            final String user = "dummy";
            final String password = "dummy";
            final String appId = "chat";
            
            APIManager mgr = new APIManager(user, password, appId );
            
            String chatUrl = mgr.getUQChatUrl();
            String siteName = mgr.getSiteName();
            
            System.out.println("Chat Url:" + chatUrl);
            System.out.println("Site Name:" + siteName);
            
            UQClient client = new UQClient(chatUrl, siteName, user, password, appId);
            
            if ( !client.authenticate() ) {
                System.err.println("UQChatService: Authentication failed.");
                return;
            }
            
            // FAILS with  Invalid ClientID
            client.setAgentState(24, true);

-- ERROR STACK TRACE
com.rightnow.ws.chat.uq.wsdl.RequestErrorFault: Invalid agent ID.
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.rightnow.ws.chat.uq.wsdl.WSChatUQServiceStub.setAgentState(WSChatUQServiceStub.java:2803)
    at test.wsdl.UQClient.setAgentState(UQClient.java:176)
    at test.wsdl.UQClient.main(UQClient.java:210)
    
-- REQUEST SOAP ENVELOPE
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header><ns3:ChatClientInfoHeader xmlns:ns3="urn:messages.common.chat.ws.rightnow.com/v1" soapenv:mustUnderstand="0">
<ns3:AppID>chat</ns3:AppID>
<ns3:SessionID>zjezgtahcvz91qfhwh5g9gvms</ns3:SessionID></ns3:ChatClientInfoHeader>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustUnderstand="1">
<wsse:UsernameToken><wsse:Username>dummy</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">dummy</wsse:Password>
</wsse:UsernameToken></wsse:Security></soapenv:Header>
<soapenv:Body>
<ns6:SetAgentState xmlns:ns6="urn:messages.uq.chat.ws.rightnow.com/v1">
<ns6:TransactionRequestData><ns6:Timestamp>2013-03-08T18:36:00.070+00:00</ns6:Timestamp>
<ns6:TransactionID>2</ns6:TransactionID><ns6:SiteName>simplictiavaya0212</ns6:SiteName></ns6:TransactionRequestData>
<ns6:AgentClientID id="24" /><ns6:Available>true</ns6:Available>
<ns6:SubState>21</ns6:SubState><ns6:Channel>CHAT</ns6:Channel>
</ns6:SetAgentState>
</soapenv:Body></soapenv:Envelope>

-- RESPONSE SOAP ENV
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body>
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:Server</faultcode>
<faultstring>Invalid agent ID.</faultstring>
<detail>
<ns3:RequestErrorFault xmlns:ns3="urn:faults.chat.ws.rightnow.com/v1" xmlns="urn:messages.common.chat.ws.rightnow.com/v1" xmlns:ns2="urn:messages.uq.chat.ws.rightnow.com/v1">
<ns3:exceptionCode>BAD_REQUEST</ns3:exceptionCode><ns3:exceptionMessage>Invalid agent ID.</ns3:exceptionMessage>
</ns3:RequestErrorFault></detail>
</S:Fault>
</S:Body>
</S:Envelope>"

Any idea on how to fix this? Any help would be appreciated :)
 

Code Block


Viewing all articles
Browse latest Browse all 2504

Trending Articles