Rectangle 27 2

Using SoapClient, this should give you an idea of how to create the SOAP call:

try {
    $client = new SoapClient('CRMLeadServiceV10.wsdl');
    $header = new SoapHeader('http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd', 'Security', array(
            'UsernameToken' => array(
                'Username' => 817221,
                'Password' => array(
                        '_' => 1234,
                        'Type' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'))));
    $params = new stdClass();
    $params->createLead = new stdClass();
    $params->createLead->LeadSourceId = 1234;
    $result = $client->__soapCall('createLead', $params, null, $header);
    print_r($result);
} catch (SoapFault $e) {
    die($e->getMessage());
}

Thanks George. I'll try this. For the 'Title' parameter, how should I write it since it contains <code>?

I'm getting this error: "SOAP-ERROR: Encoding: object has no 'createLead' property". I'm really wondering why.

SoapClient should take care of encoding it for you. Maybe it's looking for objects - see my edit.

The soap:address location in WSDL is different from that makelsabido puts in the comment and even more, the WSDL location doesn't exist. If you create SoapClient proxy with this WSDL it won't work. In the other hand the location in maikelsabido's comment has transport level security with client certificate authentication (confirmed with wireshark), a valid certificate for https connection is needed to succefull https soap call. I don't know how to do this in PHP SoapClient...

xml - Web Service SOAP Request is working on SOAPUI but not working on...

php xml web-services soap wsdl
Rectangle 27 0

I think the best you can do is log the time right before you return a value. The only way I've seen for services to continue processing after they send a response is to create another thread for it, which wouldn't help in this case.

That's what I thought but I was hoping there would be a better way around this. I'll do as suggested, thanks.

xml - How to send a C# SOAP response to SoapUI before closing the web ...

c# xml web-services soap soapui
Rectangle 27 0

I'm quite sure what you're asking for is not possible with SoapUI MockServices. There are some extensive possibilities involving scripting, and it is even possible to access the underlying javax.servlet.http.HttpServletRequest and Response objects. Have a look here for details:

Using scripting, it is possible to write a mock service request handler like this in SoapUI that just resets and closes the output stream:

mockRequest.getHttpResponse().reset();
mockRequest.getHttpResponse().getOutputStream().close();

But the client will still see a HTTP response header like this generated by the servlet container:

HTTP/1.1 200 OK
Content-Length: 0
Server: Jetty(6.1.x)

It is generally not possible to abort the connection immediately from inside a servlet (which is what SoapUI mock services are built upon). Have a look here about this topic:

I'd use something completely different than SoapUI, most likely a scripting technology like PHP or Perl to achieve what you're asking for.

Thanks for very detailed answer!

soap - SoapUI : Mock service that not returning response - Stack Overf...

web-services soap mocking soapui
Rectangle 27 0

I actually just dealt with this and sadly, there really isn't that many decent ways to handle it. It really depends on how you are getting the XML etc etc. I will presume you have the XML in a w3c.dom formatting. If not, you can use

XmlUtils.selectFirstDomNode(XmlUtils.createXmlObject(xmlString),XPath);

to create a node.

XmlUtils.setNodeValue(Node,Value);
XmlUtils.prettyPrintXml(Node);

The way SoapUI handles it's request content is very difficult to work with. It's a running joke around my office honestly, but this works quite well for us for now.

web services - Manipulating SOAP request paramenters when Integrating ...

java web-services soap wsdl soapui
Rectangle 27 0

I was able to connect to the webservice using the following code:

$client = new SoapClient ($wsdl, array('location' => $momurl, 'action'=>$action, 'style' => SOAP_DOCUMENT, 'trace' => 1,  'soap_version' => SOAP_1_1, 'exceptions' => false, 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, 'ssl_method' => SOAP_SSL_METHOD_TLS));

$header='<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <wsse:UsernameToken wsu:Id="UsernameToken-45">
            <wsse:Username>'.$usname.'</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">'.$password.'</wsse:Password>
        </wsse:UsernameToken>
    </wsse:Security>';

$headerSoapVar = new SoapVar($header,XSD_ANYXML); 
$soapheader = new SoapHeader('wsse', "Security" , $headerSoapVar , true);
$client->__setSoapHeaders($soapheader);

$params['/* the function or method that you want to use */'] = array(/* insert your parameters here */);

$result = $client->__soapCall("/* the function or method that you want to use */", $params);

Check the header part of your request if it is similar to mine. If it's not then just use your own header. Basically, just copy your request's header part and just set the variables for username and password. I've tried it on another webservice and it's working fine.

xml - Web Service SOAP Request is working on SOAPUI but not working on...

php xml web-services soap wsdl
Rectangle 27 0

Using the XML view of a Test Request test step in soapUI you can freely edit what shall be sent.

<soap...>
  <MyUpdateRequest>
    <name>true</name>
  </MyUpdateRequest>
</soap...>

You mean to say I can sent the above request "update_request" with name parameter only. There will be no error in calling with flag parameter as null?

Yes, I think so. soapUI should send the message as long as the server component providing the webservice accepts this.

and in above case? I have updated the example.

As I have written you can type anything you like. You could also edit the SOAP message to look like <soap>HelloWorld</soap> and send it.

soap - Is it possible to call web service method with less parameters ...

web-services soap soapui
Rectangle 27 0

  • create a new SoapUI project
  • double click on project in the tree
  • configure WSS settings in "WS-Security Configurations" tab
  • select WSS configuration for the mock service (beware - it is not in a pop-up but in a properties table in bottom left of the screen - see How to apply WSS to mocked response in SoapUI?

You have quite fine grained control over configuration details (used encryption and signature algorithms, encrypting only parts of messages aso.) but you do not control raw XML tags for encryption.

soapui - soap UI to generate a mock service and test client - Stack Ov...

soapui
Rectangle 27 0

definitions is a root element of WSDL so it looks like you are not loading WSDL.

I tested it and it looks like the whole problem is with your web server. Your web server returns WSDL to browser but it doesn't return it to any tool because these tools are using very minimalistic HTTP requests without many HTTP headers. One of missing headers is Accept. Once this header is not included in the request your server throws HTTP 400 Bad request.

The easy approach to continue is opening WSDL in the browser, save the wsdl to a file and import that file to soapUI instead of the WSDL from URL.

Please can you help me ?? it's 5 days i tray to fix the problem. I have not understand your answer, i am sorry. How i can test my wsdl ?? is the log error says that my web services is not working ?? thanks for your answer

No, when i add it, it show tho me the " Loading definition from url", it take this for several minutes and it show me " com.ev...: Error importing wsdl . is this mean that my wsdl is not working ?

Yes that means that WSDL cannot be downloaded or it is not correct. Can you open WSDL in browser?

I used IE/Firefox to see WSDL and I used Visual studio / svcutil (MS tools for creating service proxies) to simulate soapUI behavior (I don't have soapUI installed at home). I used Fiddler to compare communication over HTTP with your server and to test different HTTP requests until I found the difference causing the problem.

web services - WSDL/SOAP Test With soapui - Stack Overflow

web-services wsdl soapui
Rectangle 27 0

A likely possibility is that your browser reaches your web service through a proxy, and SoapUI is not configured to use that proxy. For example, I work in a corporate environment and while my IE and FireFox can access external websites, my SoapUI can only access internal web services.

The easy solution is to just open the WSDL in a browser, save it to a .xml file, and base your SoapUI project on that. This won't work if your WSDL relies on external XSDs that it can't get to, however.

web services - WSDL/SOAP Test With soapui - Stack Overflow

web-services wsdl soapui
Rectangle 27 0

This is the way I used before may be not the best.

Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

web services - Parsing and Recursion of SOAP response in SoapUI - Stac...

web-services soap groovy soapui
Rectangle 27 0

Mocking with SoapUI will start a Jetty server listening on a specified port with either REST or SOAP services. The response can be based on request content and you can run scripts in Groovy on several phases of the execution, which enables an almost unlimited extension of the tool.

soapui - Soap UI mock service - Stack Overflow

soapui
Rectangle 27 0

This is probably a WS-A addressing issue.

In the WS-A tab of your Request, check "Enable WS-A addressing". You may also have to check "Add default was:To".

SOAP Action mismatch error while testing a WCF service with SoapUI - S...

wcf soapui
Rectangle 27 0

SoapUI by default do not support swagger.

But there is an official plugin. You could give a try:

soapui - Sending Complete Response of a REST service as Input to anoth...

rest soapui swagger swagger-2.0
Rectangle 27 0

The SOAP UI raise the exception because your certificate not properly installed in SOAP UI trust store.

To resolve the above exception follow the below steps.

  • Export the certificate from the key store or browser (which contain the public key)
  • Go to the SOAPUI installed directory and locate following directory \SmartBear\soapUI- 4.0.1\jre\lib\security
  • Import the certificate in to cacerts trust store (Which is the default trust store)
  • Restart the SOAP UI and load the WSDL...

To understand more about SSL ... follow the below link ...JSSE documentation

soap - Test internal secured web service with SoapUI? - Stack Overflow

soap ssl-certificate soapui
Rectangle 27 0

public String getRequestResult(String wsdl, String operationName)
        throws Exception {
    // create new project
    WsdlProjectPro project = new WsdlProjectPro();

    // import amazon wsdl
    WsdlInterface iface = WsdlInterfaceFactory.importWsdl(project, wsdl,
            true)[0];

    // get desired operation
    WsdlOperation operation = (WsdlOperation) iface
            .getOperationByName(operationName);

    // create a new empty request for that operation
    WsdlRequest request = operation.addNewRequest("Java Req");

    // generate the request content from the schema
    request.setRequestContent(operation.createRequest(true));

    // submit the request
    @SuppressWarnings("rawtypes")
    WsdlSubmit submit = (WsdlSubmit) request.submit(new WsdlSubmitContext(
            request), false);

    // wait for the response
    Response response = submit.getResponse();

    return response.getContentAsString();
}

web services - How to generate example SOAP request with SoapUI in jav...

java web-services soap wsdl
Rectangle 27 0

Instead of using AutoIt to push the SoapUI gui automatically,

You can also setup an AutoIt script to execute testrunner.bat.

I have setup SoapUI project for the web service. Now I am trying to execute it from command line using the 'testrunner.bat' but I am getting following error 'log4j:ERROR setFile(null,false) call failed. java.io.FileNotFoundException: soapui.log (Access is denied)' in the command prompt. I assume the problem is with the write permissions for the folder I have mentioned to log my results into. I gave write permissions to the folder but I am still getting the error. What might be going wrong?

give a try to run testrunner in admin mode or start testrunner from your user directory

Thanks @codedad. The problem was solved. The write permissions for the 'soapui.log' file was missing. I gave the write permissions to the concerned files in the SOAPUI/Bin folder and the problem got solved. I am able to run SOAP UI tests from command line but there's another problem now. When I run the tests from SOAP UI window, the requests are successful but when I run from command line, the reports being generated for each testcase is showing me the status as 'UNKNOWN' ie. the status in response is 'HTTP/1.1 404 Not Found'.What might be the reason for this?

soapui - Can we automate sending requests to a web service in SOAP UI ...

soapui autoit
Rectangle 27 0

Your web service is returning a SOAPFault which is saying that web service expects a SOAP Action http header. In order to add a SOAP action in your SOAP request from SOAPUI you must add a http header named SOAPAction, to do so do the next step:

  • In the bottom of your SOAP test request there are some tabs (Header(0), Attachments(0)...), open the Header(0) tab.Then using + add button, add a header with SOAPAction name and your value:

Yes thats right. Can you also reply how to add this using a Java client. I generated the stubs using Apache Cxf from the wsdl.

@james2611nov take a look at this question which explains a possible way to add the SOAPHeader in http-header using CXF. If this doesn't fit your requirements try to ask your own question with more details about your exact problem. Hope this helps :)

SOAP Action mismatch error while testing a WCF service with SoapUI - S...

wcf soapui
Rectangle 27 0

Try disabling the proxy in SOAP-UI, which indicated in the attached screen shot. Or Give a valid proxy connection under Proxy settings in SOAP UI Global preference.

By disabling the proxy preference SOAP UI may work in offline.

soap - Getting an error connecting web service using SOAPUI - Stack Ov...

web-services soap xsd wsdl soapui
Rectangle 27 0

I actually just dealt with this and sadly, there really isn't that many decent ways to handle it. It really depends on how you are getting the XML etc etc. I will presume you have the XML in a w3c.dom formatting. If not, you can use

XmlUtils.selectFirstDomNode(XmlUtils.createXmlObject(xmlString),XPath);

to create a node.

XmlUtils.setNodeValue(Node,Value);
XmlUtils.prettyPrintXml(Node);

The way SoapUI handles it's request content is very difficult to work with. It's a running joke around my office honestly, but this works quite well for us for now.

web services - Manipulating SOAP request paramenters when Integrating ...

java web-services soap wsdl soapui
Rectangle 27 0

  • That didn't fix my problem, though. I had to create a new WCF project from the beginning and manually copy the code. That fixed it. Good luck.

When you change a namespace in your code, also make sure you change it in web.config!

web services - WSDL/SOAP Test With soapui - Stack Overflow

web-services wsdl soapui