Generating Error mail along with the package name

hi all,

i didnt find a suitable forum for this , so im posting my query in webmethidsEDI.

When ever an error comes i need to send generate the mail.
im generating the mail using smtp builtin service which is already available in webMethods.

In the body of the mail im getting the service name but i want the package name also


at present how im getting is


pls advice me how do i achive this


in WM normally if you select the service and copy and paste in the editor it will give you fully qualified name (foldername.subfoldername:serviceName).
That’s the way it should behave as the folder is the namespace not package.

If you want the package also the you have to do it mannually( add the Package name in front of the fully qualified name to make it as needed by you ‘packagename.foldername.subfoldername:serviceName’)



I cant hard code all the packge names right.
Im writing a common service to move files, this common service im calling in my applications. for ex PKG_A , PKG_B, PKG_C
These three packages are three different applications which use common service moveA2AFiles.

which ever application fails to transfer files , generating the error mail , in the body of the error mail im able to get the service name as i have mentioned before.

In this scenario i think its not advisable to hard code the package name.

any other way to customize this???

normally fully qualified name starts with the top level folder inside the package. In you case foldername.subfoldername:serviceName.

I don’t think is there is any way to get the package name associated to it.

But why do you need the package name as is doenot count to the qualified namespace?

Other thing What I understand is

you are calling a common service(moveA2AFiles) from 3 PKG’s.
and where do set the said service name ( I Mean foldername.subfoldername:serviceName).

IMO, have a variable as input to this common service.
whenever you call the common service send the fully qualified name (even the attached package name ) as this input.

In the common service, if you have errors copy the variable contents to the body of the email that u send out.


As in webmethods package name will not come under fully qualified name we have to hard cord the package name if required. As it also not possible create one folder under the package with same name and in that package create the package structure which you want to wish… and copy the service name…


If you can modify the package structure then it would be good idea to have the same name for the package and the top level folder in it.
By this when you make a copy of the service it will give you the foldername.subfoldername:serviceName (foldername is same as package name). But if you call the common service from 3 pkg’s u still need to pass the varaible (for representing the fully qualified name) as mentioned earlier.

but incase you don’t want to change the package structure then go with my previous post.



When ever you create a new custom packages its best practice to keep the folder interface name same as package name this will accomplish your requirement.This is the standard practice.

—PurchaseOrder(higher folder name same as package name)
----maps (sub folder name)
finally PurchaseOrder.maps…


Well, naming the top-level folder, the same as the package name is one style for naming folders, but I would not call it a best practice or standard practice.

If, however, you are using this style of naming your folders, then you don’t need to do anything special to obtain the package name.

The real question is “why do you think that you need the package name?”. If there’s no good reason, then this whole thread is moot.


That’s was one of my doubt’s expressed earlier.


I’d call it a “very common practice.” I’ve seen it virtually in every project I’ve worked. Granted, I’m the reason the practice is followed in some of the cases :slight_smile: but the practice seems to me to be so prevalent that it’s more or less a de facto standard.

I think there was a thread on this some time back but it might be worth reviewing the subject again. When would one not want to use this technique? My position is that this technique should be followed always but perhaps I’m being myopic.

AFAIK, this naming technique certainly simplifies matters in tracking down services and their dependencies in major projects (containing several packages). The only drawback would be a longer qualified name for a service (due to the highest folder). Think we can live with that. :slight_smile:

Hi All

I think what Sheik wants is a flowservice that can let him figure out the current running flowservice, so instead of hard coding the flowservice name in each service, he can just call this service and map the output to email body.

I have a similar issue , where I have a common error handling service for a lot of services. I need to figure out the last called flowservice (before the error handler) from this error handling service with out passing the service name to it. Any ideas or am I asking for too much :smiley:

best regards

Basically you can use wM JAVA API to get current service name,see this old thread.


Thanks for that RMG!