Improve company productivity with a Business Account.Sign Up

x

SOAP Protocol

260

Solutions

395

Contributors

Simple Object Access Protocol (SOAP) is a protocol specification for exchanging structured information in the implementation of web services. It uses the XML Information Set for its message format and uses other protocols, notably Hypertext Transfer Protocol (HTTP) and the Simple Mail Transfer Protocol (SMTP) for message transmission.

Share tech news, updates, or what's on your mind.

Sign up to Post

I have the following JavaScript making a call to a PHP page:

	function callPhpAPI(youdata) {
	
		$.post( "http://www.utahkidsfoundation.com/recsoap.php", { mes: youdata } );
	
	}

Open in new window



PHP page:

<?php

$mes=$_REQUEST['mes'];


    $emailto = 'xxx@gmail.com';
    $toname = 'Tom';
    $emailfrom = 'xxxr@xxx.com';
    $fromname = 'xxx';
    $subject = 'activity on xxx detected:  ' + $mes;
    $messagebody = 'There was a page hit on xxx:  ' + $mes;
    $headers = 
        'Return-Path: ' . $emailfrom . "\r\n" . 
        'From: ' . $fromname . ' <' . $emailfrom . '>' . "\r\n" . 
        'X-Priority: 3' . "\r\n" . 
        'X-Mailer: PHP ' . phpversion() .  "\r\n" . 
        'Reply-To: ' . $fromname . ' <' . $emailfrom . '>' . "\r\n" .
        'MIME-Version: 1.0' . "\r\n" . 
        'Content-Transfer-Encoding: 8bit' . "\r\n" . 
        'Content-Type: text/plain; charset=UTF-8' . "\r\n";
    $params = '-f ' . $emailfrom;
    $test = mail($emailto, $subject, $messagebody, $headers, $params);
    // $test should be TRUE if the mail function is called correctly

    header("Location: http://xxx.com");

    die();
?>

Open in new window



The email IS being sent, but the PHP variable $mes that I am attempting to make use of has a problem.


The email when it arrives looks like this:

zero

What I expected was to see the following subject and message body:

subject: 'activity on xxx detected:  content of param passed in
message body: 'There was a page hit on xxx:  content of param passed in

If I remove the $mes PHP variable I am trying to append to the end of the subject and message body (above) -- the subject and message body come through GREAT, minus the custom message(which is the entire point of all this)

zero
0
Free Tool: IP Lookup
LVL 12
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Hi,

I'm in the process of developing an eBay application in Microsoft Access 2016. So far my project has been fine and the API calls I have made have been successful but I have now come to a stumbling block that I need some help with.

The API calls I have used so far are all for single listings so this is easy and I just pass the XML through an HTTP request. I want to make this much more efficient and use eBay's File Transfer API where I can send more than 1 call at a time but I'm really struggling on trying to understand how to build the call.

The data has to be sent as Binary Base64 which I have a converter to do this. I can build the XML that needs to be sent but I just don't understand how to send the XML from a string as apposed to a physical file.

I've read loads on the internet about having to create it as a multipart request with boundaries but really not sure how to start building that. I can provide code if need be so you can see where I am at.

I hope this makes sense.
0
I'm trying to figure out why I can't seem to decrypt an encrypted key from .NET with a X509 Certificate.  

.NET Code
encryptedKey = "jW3VDsUZWIdzfZ1bPN3iKI2Pf9u22kUax0DFnF3A9H+nvcBQuVC2efw1FYGm5/AvnN27kXqA4PyCqcQLp/tguVqHtzdR7mJtkTCyY8TUoAej2Mqzv2uiEKULB/8rlPDl2DOkSMGJqieenAG/7gZjWhlU0eYrlcMi5dtAnPFTfy+LvtJ6bbGEDgy4FhoT49T6sO0kjBJHp5YI0p/CeEuc+WMT/BMGG1YuDPswltj0VzeaE3KbHSLvJPjGCQ3U0YkUWm8h9zM22S/mRvfMhEu1aRdQpojGUiSLKUJyotNu8fRulKeB1TVuE7AlDGrbAUsRtU+y6PdLMcEHW+BRq5Uouw==";

var encryptedKeyByte = Convert.FromBase64String(encryptedKey);

var clientCert = new X509Certificate2(@"C:\certificates\xxxxx.pfx", "xxxx");
var rsa = (RSACryptoServiceProvider)clientCert.PrivateKey;
byte[] key = rsa.Decrypt(encryptedKeyByte, false);

Open in new window


The error I get when I try to run the last line of the code rsa.Decrypt(encryptedKeyByte, false)
The parameter is incorrect.


In SOAP UI the decryption works where I use the same certificate.  I just had to convert the file pfx to a jks file to get it working in SOAP UI.  But other than that the settings look the same to me.
Here is a screen shot of the SOAP UI settings.  I'm guessing the Signature Keystore in the SOAP UI seetings is not used for the decryption process.  The Decrypt Keystore settings in SOAP UI is the one I'm using in .NET.  Only in .NET its a pfx file.  
SOAP UI Settings
I also imported the certificate to my local box to see some of the details.  Here is what I see:
Certificate seen in MMCcertificate_properties_in_mmc_2.pngCertificate seen in MMC
Please let me know if you need me to provide any other information or need me to test something out.  Thanks in advance for your help.
0
I have a soap message that is signed with a x509 Certificate. How do I manually decrypt it. I would think this would be easy but I can't seem to figure it out.

I tried this example but it did not work for me.
https://stackoverflow.com/questions/20743256/how-to-decrypt-raw-soap-response-encrypted-with-x509
0
I'm using C# to call a Java Webservice.  Fiddler gives me a status of 200. So my call to the service is good.  But something in the .NET does not like my MTOM message.  Any ideas?  Here are all the details.  

I'm getting this error:
MTOM messages must have type 'application/xop+xml'.

Open in new window


The stack trace says:
Server stack trace: 
   at System.ServiceModel.Channels.MtomMessageEncoder.MtomBufferedMessageData.TakeXmlReader()
   at System.ServiceModel.Channels.BufferedMessageData.GetMessageReader()
   at System.ServiceModel.Channels.BufferedMessage..ctor(IBufferedMessageData messageData, RecycledMessageState recycledMessageState, Boolean[] understoodHeaders, Boolean understoodHeadersModified)
   at System.ServiceModel.Channels.MtomMessageEncoder.ReadMessage(ArraySegment`1 buffer, BufferManager bufferManager, String contentType)
   at System.ServiceModel.Channels.HttpInput.DecodeBufferedMessage(ArraySegment`1 buffer, Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
   at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(HttpRequestMessage httpRequestMessage, Exception& requestException)
   at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at 

Open in new window

0
I am requesting a web service through an xml, I verify the answer with the Fiddler tool and it returns an Http 200, but the answer as such does not return the information that the web service should send me but it returns the wsdl of the same. I do not know if you are making any mistakes in the programming, please help me.

private void SendXmlToWebService()
        {            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(@"C:\inetpub\wwwroot\WsSAt\XmlPeticion.xml");
            StringBuilder rawXml = new StringBuilder();
            rawXml.Append(GetXmlString(xmlDoc));
            PostXml("http://10.181.236.3:9094/axis2/services/SISE_IDC?wsdl", rawXml.ToString());
        }

        static string GetXmlString(XmlDocument xmlDoc)
        {
            StringWriter sw = new StringWriter();
            XmlTextWriter xw = new XmlTextWriter(sw);
            xmlDoc.WriteTo(xw);
            return sw.ToString();
        }

        public void PostXml(string url, string xml)
        {
            byte[] bytes = Encoding.UTF8.GetBytes(xml);
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            request.Method = "POST";
            request.ContentLength = bytes.Length;
            request.ContentType = "text/xml; charset=utf-8";
            request.Host = "10.181.236.3:9094";
            request.Accept = "gzip,deflate";

            using (Stream requestStream =
0
I am requesting a web service through an xml, I verify the answer with the Fiddler tool and it returns an Http 200, but the answer as such does not return the information that the web service should send me but it returns the wsdl of the same. I do not know if you are making any mistakes in the programming, please help me.
0
hi,
Is it possible, in Embarcadero delphi, to be connected to a WEB-Services SOAP (imported with WSDL-Import and with THTTPRIO component ) with a https connection and where the WebServices need a Certificate? How set the certificate?
I need an example.
Thanks,
0
Consuming ASPNET WSDL service using PHP
Hi Experts,
having some serious issues getting this one right. I am writing a PHP web app that needs to post an xml to an ASPNET WSDL service. Upon submitting data via PHP service it gives me an error "SoapFault exception: [s:Client] An error has occurred during service execution halting any further processing."
I then decided to use ReadyAPI and the error it gives is "HTTP/1.1 415 Cannot process the message because the content type 'multipart/related; type="text/xml"; start="<rootpart@soapui.org>"; boundary="----=_Part_0_2905742.1520010170903"' was not the expected type 'text/xml; charset=utf-8'."

Really baffled with this one. Have tried so many different soap codes to submit data and same response. any suggestions?
0
Our company is moving some components to our internal cloud and I am working in a project and one of the task is to expose an existing legacy java class as soap web service. Can anyone please help me stir in the right direction? How can  I write a soap Producer on existing new class and methods? Should I write a new class and extend this class or should I write a subclass? What is the best  way  to approach  this?I  am new  to integration projects. The company is using  Mule  Esb as an integration solution? Also how Mule esb fitst together  with all this?I am new to  Mule  esb.
0
Free Tool: SSL Checker
LVL 12
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

with the help of experts on this exchange i managed to cobble together this code
it does work almost, but it produces a text file and not an xml document file, or i am not smart enough to load the xml document.
So any help would be appreciated

Sub plireader()
'On Error Resume Next

'CEMgetattendance -  CLETracker
'DEV_getattendance -152413
 

Dim strrequest As String
Dim objhttp As Object
    strXmlToSend = "<company>CLETracker</company>"
    '    strXmlToSend = "<company>CLETracker</company>"

webserviceurl = "https://www.pli.edu/public/CEM/Service.asmx"

 Set objhttp = CreateObject("Msxml2.XMLHTTP.6.0")
MsgBox "send now"
  strrequest = "<?xml version=""1.0"" encoding=""utf-8""?>" _
               & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" _
               & "<soap:Body>" _
               & "<CEMgetAttendence xmlns=""http://www.pli.edu/public/CEM/"">" _
               & "<company>CLETracker</company>" _
               & "</CEMgetAttendence>" _
               & "</soap:Body>" _
               & "</soap:Envelope>"
Dim resp As String

MsgBox strrequest
objhttp.Open "POST", webserviceurl, False
objhttp.setRequestHeader "SOAPAction", "http://www.pli.edu/public/CEM/Service.asmx?op=CEMgetAttendence"

objhttp.setRequestHeader "Content-Type", "text/xml"
objhttp.send (strrequest)
  ' resp = http.HttpGetText(url)
0
I am trying to get XML validation working for a SOAP server but I've run into a couple of issues.

XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://p2p.thalesgroup.com/wsdl/status/xsd"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified"
  attributeFormDefault="qualified"
  targetNamespace="http://p2p.thalesgroup.com/wsdl/status/xsd">
 
  <xsd:element name="Alive">
    <xsd:complexType>
      <xsd:annotation>
        <xsd:documentation>
          - Alive is sent periodically to verify the connection status
        </xsd:documentation>
      </xsd:annotation>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>

Open in new window


XML:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:soap-enc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Body><Alive/></soap:Body>
</soap:Envelope>

Open in new window


First Issue:
SOAP elements are not being recognized.
Validator Output: Cannot Find The Declaration Of Element 'soap:Envelope'., Line '1', Column '225'.
I found a Stack Overflow thread describing the same issue but the described solutions do not work for me.

Second Issue:
Even if I remove the SOAP elements, I still have a namespace issue.
Validator Output: Cannot Find The Declaration Of Element 'Event'., Line '1', Column '8'.
0
Hello,

I have a webservice that I,m trying to apply a custome security, when I try to call the service it display the following error:


http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">a:FailedAuthentication

At least one security token in the message could not be validated.


To add the security I modify the service config file:

[b][b]<services> <service name = "WcfService1.Service1"> <endpoint address="" binding="customBinding" bindingConfiguration="customBindingOasis" contract="WcfService1.IService1"> <headers> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken> <wsse:Username>USERNAME</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> </headers> </endpoint> </service> </services> <bindings> <customBinding> <binding name ="customBindingOasis"> <security authenticationMode="UserNameOverTransport" includeTimestamp="false" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> <secureConversationBootstrap /> </security> <textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap12" writeEncoding="utf-8"> <readerQuotas maxDepth="32"
0
any one can help me for this php code
soap.php
0
Hello,

I have this WCF service that works fine using soap1. I'm trying to change it to run in soap1.2 but I have not been able.

I have try changin diferents things in the webconfig.

First I change the basicHttpBinding for wsHttpBinding.  I also change the protocol , remove the soap1.1 and add the soap 1.2

How I can made that my WCF web service run in soap1.2?
0
I have a username and password for the real estates agent theysaid I have to call the web service and get a response but
How can I integrate to my theme in wordpress if u want to help me will be good or I can hire you too but I like to learn anny I wait for your answer guys thank you
0
Hi my soap client is not sending any xml request to the soap server. I tried sending data with wsdl link.

require_once('../libs/nusoap.php');
$client = new nusoap_client('http://url.com/wsdlfilelink', 'wsdl');

....

$merchantIDStruct = new stdClass();
$merchantIDStruct->name = 'merchant_id';
$merchantIDStruct->value = '1234567';

$detailArray = new stdClass();
$detailArray->item = $merchantIDStruct;

$parameters = new stdClass();
$parameters->details = $detailArray;
$parameters->billerRef = "RB_C1_RECO";
$parameters->payinstrRef = "RB_C1_RECO";

//$param_merchant_id = array( "merchant_id" => "5235437" );
//$parameters = array("Request" => $param_Request, "merchant_id" => $param_merchant_id);
$query = 'php';
 /* create the proxy object */
$proxyclientwsdl = $client->getProxy();
$result = $proxyclientwsdl->RECOstep1($parameters);


WSDL:

<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:typens="urn:PaymentServer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="RECOstep1" targetNamespace="urn:PaymentServer">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:p="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="urn:PaymentServer">
<xsd:element name="Request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="billerRef" minOccurs="1" maxOccurs="1">
<xsd:simpleType>
0
I had this question after viewing New to SOAP and need some direction.
0
I am part of a development for a SOAP web services client on WCF/.NET. After a session of sending request, team for server side left feedback "extend someAction from schema i am mentioning below", and mentioned an URL. In this context, what does it mean to extend from schema?
0
Keep up with what's happening at Experts Exchange!
LVL 12
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Working with a web service and a little out of my depth.  The example that I have been given asks for my cert with my private key as an option in stream_context_set_option.  Could this expose the private key unnecessarily / does this actually submit to the service?
0
I need a step by step instruction how to build a soap web service using PowerBuilder 12.6 or 2017 in Classic.
0
Hi,
I'm trying to use a webservice (.net if it matters).
Using the code directly below I get a response.
$options = array(
	'username' => "myusername",
	'password' => "mypassword"

);

$url = "https://service.mydomain.com/soap12";

$client = new SoapClient($url);
$client->__soapCall('login',$options);
$fcs = $client->__getFunctions();
dd($fcs);

Open in new window


I get a return so thinking something is working (shortened below):
array:145 [▼
  0 => "UNKNOWN ActivityChange(UNKNOWN $par)"
  1 => "UNKNOWN Admin(UNKNOWN $par)"
  2 => "UNKNOWN DirectIntefaceTest3(UNKNOWN $par)"
  3 => "UNKNOWN DirectIntefaceTest(UNKNOWN $par)"
  4 => "UNKNOWN LogEntryGet(UNKNOWN $par)"
  5 => "UNKNOWN LogEntryDetails(UNKNOWN $par)"
  6 => "UNKNOWN SystemUploads(UNKNOWN $par)"
  7 => "UNKNOWN TestUpload(UNKNOWN $par)"
  8 => "UNKNOWN AppointmentGet(UNKNOWN $par)"
]

Open in new window


I'm trying to use the AppointmentGet. Trying below:
$params = array(
	'AppointmentSince'  =>'2017-07-11T07:00:00',
	'AppointmentUntil'  =>'2017-07-11T012:00:00',
	'SerialNumber'		=> '9999'
);

$response = $client->__soapCall('AppointmentGet', $params);
also:
$response = $client->AppointmentGet($params);

Open in new window

Regardless same error:

SoapFault in TestController.php line 70: Internal Server Error
(line 70 being the $response line)

The company that provides the service has some documentation:
https://partnerhub.pbsdealers.com/soap12/metadata?op=AppointmentGet

Any ideas?
0
Trying to consume webservice using wcf client, getting following error

The content type multipart/related; boundary=MIMEBoundaryurn_uuid_B50EC784A204DC07C91495512014914; type="text/xml"; start="<0.urn:uuid:B50EC784A204DC07C91495512014915@apache.org>"; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the  . The first 1024 bytes of the response were ...

Fiddler is showing the complete response but wcf is not able to deserialize the complete response. Response contains Japanese characters.
0
Example for WinRM  API using SOAP
0
Hi,
we are in need of technical help to achieve secure comms using secure Soap (certificated) to a government web-service.
We have to send and receive encrypted SHA256 xml content as the payload using SSL transport.
Is this an area in which you have expertise?
If so, we are prepared to pay for consulting/help if a working result can be achieved.
If you have expertise here, and are able to offer guidance, then we can send real code and proper full description of our problems.
Thanks,
Justin Graham.
New Zealand (GMT + 12)
0

SOAP Protocol

260

Solutions

395

Contributors

Simple Object Access Protocol (SOAP) is a protocol specification for exchanging structured information in the implementation of web services. It uses the XML Information Set for its message format and uses other protocols, notably Hypertext Transfer Protocol (HTTP) and the Simple Mail Transfer Protocol (SMTP) for message transmission.

Top Experts In
SOAP Protocol
<
Monthly
>