asp vbscript soap call add header - soap

i need to make a soap wsdl call which i do as follows:
dim soap
Set soap = CreateObject("MSSOAP.SoapClient30")
soap.ClientProperty("ServerHTTPRequest") = True
Call soap.MSSoapInit( "http://10.0.0.1:8080/Logon?wsdl", "Logon")
soap.ConnectorProperty("Timeout") = 90000
result = soap.getAuthorization(id)
I need to add a wssecurity header, does anyone know how i can go about it, i have the header i need to send i just donno how to attach it.

This might help:
VB6 Code

Related

How to send request with a set http_header in Erlang Package a SOAP github package

I am using this erlang-package on Github to work with WSDL and SOAP, and I am only using the package for Client generation! I have not erlang knowledge at all - only basic elixir.
My Problem:
How can I send a request with an authorization header?
Lets say the code to test my service looks like the following:
connectionCheck() ->
'WsdlService_client':connectionCheck(
#'P:connectionCheck'{
clientSoftwareKennung = "Elixir"},
_Soap_headers = [],
_Soap_options = [{url,"http://localhost:8091/myservice/v2.0/connectionCheck"}]).
Which parameter needs to be filled in and what do the parameters look like when I need the following header in the resulting http-request?
Authorization: Basic <placeholder encodeded user password>
Thanks!
I was able to solve it by myself.
If you need to pass some http-Headers to your Soap-Request you can do it like that:
_Soap_options = [{url,"http://localhost:8091/myservice/v2.0/connectionCheck"},{http_headers, [{"Authorization","Basic Encoded User-Pass"}]}]).

How do I create a SOAP request directly by parsing the WSDL file?

I was tasked to create Perl scripts which can create an XML payload with supplied parameters and invoke a SOAP call, then read the response and parse parameters to provide for the next use. I am pretty new at SOAP messaging.
I have a WSDL file based on which I am able to manually create an XML SOAP message, but I do not think this is the right way how to do it. I also do not understand how to invoke a SOAP call. Yes, I can read the documentation and I have read it a couple of times, but I want to ask if there is possibility to create a SOAP request directly by parsing the WSDL file. What are the possibilities for this topic?
I only have a description or pseudocode for what it should do and I am quite new at SOAP/Web services. Do you have any link to what could be useful for me?
I would recommend XML::Compile::WSDL11
From the docs:
use XML::Compile::WSDL11 ();
# once in your program
my $wsdl = XML::Compile::WSDL11->new('def.wsdl');
# XML::Compile::Schema refuses to follow "include" and
# "import" commands, so you need to invoke them explicitly.
# $wsdl->addWSDL('file2.wsdl'); # optional
# $wsdl->importDefinitions('schema1.xsd'); # optional
# once for each of the defined operations
my $call = $wsdl->compileClient('GetStockPrice');
# see XML::Compile::SOAP chapter DETAILS about call params
my $answer = $call->(%request);

POSTa Request with rest assured api using XML Payload

I am in need of one requirement.I want to POST a request using Rest Assured API using XML payload,I did not get any where how to set the body using XML. any one please tell me how I can achieve this.
I have one table customers with 5 fileds,name,id,address,email and phone number.My URL to post the request is something like
"http://com.myproject.app:8080/MyApp/SchmaName/customers".Please any one help me out.Thanks in advance
The above should work, here it is again in a slightly different version with your example...
Response response = given().
contentType("application/xml").
body(myXML).
when().
post("http://com.myproject.app:8080/MyApp/SchmaName/customers");
myXML would be the xml you want to send (5 fields; name,id,address,email and phone number). After that you can pull the result from response.
You can just post in the request body as a String, InputStream, byte[] or a Java object (that will be serialized to XML using JAXB). For example:
String myXML = ..
given().contentType(ContentType.XML).body(myXML).when().post("/x").then(). ..

SOAPUI Extract data from SOAP Response and use in REST request

I have been looking at the answer to this question:
Pulling details from response to new request SoapUI
which is similar to what I am looking for but I can't get it to work.
I have a small SOAPUI testsuite and I need to extract a value from the response of a SOAP request and then use this value in a subsequent REST request.
The response to my SOAP request is:
<ns0:session xmlns:ns0="http://www.someurl.com/la/la/v1_0">
<token>AQIC5wM2xAAIwMg==#</token>
</ns0:session>
so I need the token to use in my REST request. I know it involves using Property Transfer and some XPath / XQuery but I just can't get it right. At the moment my property transfer window points to Source: SOAP test Property: Response and has data(/session/token/text()) in the text box. In target it has Target: REST testcase Property: newProp and I have Use XQuery checked.
Any help greatly appreciated.
Thanks,
Adrian
I think you just need to declare the namespace ns0 and use it in the XPath. Also, uncheck the XQuery, it is only used when you are using XQuery, not XPath.
Replace your expression with this:
declare namespace ns0='http://www.someurl.com/la/la/v1_0';
/ns0:session/token/text()

Manually generating x-gwt-rpc from Python

I want to access a GWT service from a Python script, so I want to generate a x-gwt-rpc request manually. Can't seem to find any info on the format of a GWT RPC call, since everybody does it from Java (so the call is generated by the framework). Where can I find some detailed documentation about this format?
Don't think it is a trivial task to do that, but because gwt is opensource i would say that the source-code is a pretty good documentation for how it works, if you know java that is.
Gwt source
I stumbled on the same problem as you and I think I solved it rather easily.
Though I haven't figured out how to catch the response properly, I managed to get the response and successfully send the request. Here is what I did:
import requests
url = 'yours url'
header = {'Accept':'*/*',
'Accept-Encoding':'gzip, deflate',
etc...
}
cookie = {cookies if needed
}
data_g = 'this would be request payload u can see in F12 of browser '# u just copy it and paste it, !!!like a string (UTF-8 chars)
t = requests.post(url, headers=header, data = data_g, cookies = cookie)
print vars(t).keys()
#line above will print all variables of t
print t
Also these are some good links you should check out:
https://github.com/GDSSecurity/GWT-Penetration-Testing-Toolset
https://docs.google.com/document/d/1eG0YocsYYbNAtivkLtcaiEE5IOF5u4LUol8-LL0TIKU/edit?hl=de&forcehl=1